#import "WGApp.h"
#import "WGView.h"

@implementation WGApp

- (void)applicationDidFinishLaunching:(GSEventRef)event;
{
	struct CGRect frame = [UIHardware fullScreenApplicationContentRect];
	frame.origin.x = frame.origin.y = 0.0;
    
    mainWindow = [[UIWindow alloc] initWithContentRect:frame];
	mView = [[WGView alloc] initWithFrame:frame];

	[mainWindow setContentView:mView];
	[mainWindow orderFront:self];
	[mainWindow makeKey:self];
}

- (void)applicationWillTerminate;
{
	[mView release];
	[mainWindow release];
	
	NSLog ( @"WGApp closed." );
}

- (void) applicationResume: (struct __GSEvent *) event {
	NSLog ( @"WG resume" );
}

- (void) applicationSuspend: (struct __GSEvent *) event {
	NSLog ( @"WG suspend" );
	[self terminateWithSuccess];
}

- (void)applicationWillSuspend {
	NSLog ( @"WG will be suspended" );
}

@end
